package website.seamonster.ethegg.dataobject;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Objects;

/**
 * Created by 罗海量
 * 2018-07-20 01:32
 */
@Entity
@Table(name = "sys_egg_counter")
@Slf4j
@Data
@DynamicInsert
@DynamicUpdate
public class EggCounter {

    private long cnt;

    @Id
    @Column(name = "CNT")
    public long getCnt() {
        return cnt;
    }

    public void setCnt(long cnt) {
        this.cnt = cnt;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        EggCounter that = (EggCounter) o;
        return cnt == that.cnt;
    }

    @Override
    public int hashCode() {

        return Objects.hash(cnt);
    }
}
